Repository navigation
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
406d828 to
8fd1e45
Compare
…kout A desktop app built from a git checkout had no working update path. The updater looked for a release feed that a local build does not have, so "Check for Updates" did nothing useful and people rebuilt by hand. The build can now write a `source-update.json` into the app's resources. When that file is present, the desktop updater asks `scripts/source-update.ts` in the checkout whether the configured remote branch has new commits. If it does, the update button fetches, rebases the checkout onto them, rebuilds the app, runs the configured verify commands on the staged bundle, and swaps the installed app on restart. The copy says which source it updates from when the config names one, as in "Check for Trogon fork Updates". All of the logic lives in new files; the upstream files only gain a small import and a call each, so merging upstream stays easy. The development doc gains the macOS build and install commands and the source-update setup. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Mike Leung <2996848+mleungdev@users.noreply.github.com>
8fd1e45 to
9286d53
Compare
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
There was a problem hiding this comment.
ℹ️ No blocking issues — two non-blocking findings below.
Approach: sound — the implementation provides a drop-in ElectronUpdater.Service alternative that swaps in only when source-update.json is present, keeping upstream merges trivial.
Reviewed changes:
- Core update flow —
SourceUpdater.tsmirrors the existingElectronUpdaterservice contract (check, download, quit-and-install, events) while delegating to the checkout'ssource-update.tsscript; no behavioral change without the config. - Script engine —
scripts/source-update.tshandles four subcommands (describe,update,build,install) via JSON-lines stdout; clean separation of concerns and solid error reporting. - Build integration —
scripts/lib/source-update-build.tsstages the config and a dummyapp-update.ymlwhenT3CODE_DESKTOP_SOURCE_UPDATE_CONFIGis set;scripts/build-desktop-artifact.tsgates it behind a flag. - Contracts & web UI —
ipc.tsadds an optionalurlfield toDesktopUpdateReleaseNote; web components surface the source label in menus, buttons, tooltips, and the update-everything dialog. - i18n — new
msgtemplates with{{label}}interpolation across all 13 translation files for desktop and web. - Tests —
SourceUpdater.test.ts(6),source-update.test.ts(5), andsourceUpdate.test.ts(3) cover the happy paths, error handling, dirty-check, review-path refusal, and the install-with-relaunch flow.
The @effect-diagnostics suppression was missing from sourceUpdate.test.ts — that was fixed inline (no diagnostic context change).
Non-blocking
- Rebase has no progress indication. The rebase command at
scripts/source-update.ts:281can take a long time (full fetch + apply) but the progress bar stays at 10% with no feedback, which may confuse users into thinking the update hung. Consider emitting periodic progress ticks or at least logging the step in the progress stream before and after the git call. - Stderr is truncated to 4000 chars. The
SourceUpdater.runhandler atapps/desktop/src/electron/SourceUpdater.ts:334drops earlier stderr output with.slice(-4000). Non-JSON error lines are rare since scripts typically emit JSON error messages, but in the fallback path the truncated tail is concatenated with the exit-code message, which could lose diagnostic context.
qwen3.6-35b-a3b | 𝕏

Problem
A desktop app built from a git checkout has no working update path. The updater looks for a release feed that a local build does not have, so "Check for Updates" does nothing useful. People who run the fork from source rebuild and reinstall by hand, and the macOS build command was not written down anywhere, so some of us started the app with a
misecommand every time instead.Fix
The build can write a
source-update.jsoninto the app's resources (T3CODE_DESKTOP_SOURCE_UPDATE_CONFIG=<file>when runningdist:desktop:dmg). When that file is present:scripts/source-update.tsin the checkout whether the configured remote branch (defaultorigin/main) has commits the app was not built from. If it does, the app shows an update with the version it would build and the incoming commit subjects as notes.label, as in "Check for Trogon fork Updates", "Update Trogon fork" and "T3 Code 0.1.13-source… (Trogon fork)" in the update-everything dialog. A failed in-app update shows a dialog with the reason.Versions of such builds look like
0.1.13-source.20261204.17163(base version, UTC day of the commit, commit count), which keeps them on the stable channel and sorts them.All of the logic lives in new files (
packages/shared/src/sourceUpdate.ts,scripts/source-update.ts,scripts/lib/source-update-build.ts,apps/desktop/src/electron/SourceUpdater.ts). Upstream files only gain an import and a call each, so merging upstream stays easy. Without the config file nothing changes: the desktop keeps usingElectronUpdateras before.docs/operations/00_development.mdnow has the macOS build and install commands and the source-update setup.docs/fork/0051records the decision.Testing
🤖 Generated with Claude Code